﻿#ifndef LENSMANAGEDIALOG_H
#define LENSMANAGEDIALOG_H

#include <QDialog>
#include <QLineEdit>
#include <QComboBox>
#include <QDialogButtonBox>
#include "LensManager.h"
#include "../Nosepiece_global.h"

const int LENSCOUNT = 8;

namespace Qly
{

class ColorComboBox;

class NOSEPIECE_EXPORT LensManageDialog : public QDialog
{
    Q_OBJECT

public:
    explicit LensManageDialog(LensManager *l, QWidget *parent = nullptr);
    ~LensManageDialog();
    void loadLensData(LensManager * l);
    void dumpLensData(LensManager * l);
    void accept() Q_DECL_OVERRIDE;
    //void
signals:
    void lensDataChanged();
private slots:
    void updateLensCount(int n);

    void onClicked(QAbstractButton *button);
private:
    void setupUi();

    QComboBox *comboBoxLens[LENSCOUNT];
    QLineEdit *lineEditName[LENSCOUNT];//物镜名称
    QLineEdit *lineEditUmPix[LENSCOUNT]; //
    QLineEdit *lineEditNA[LENSCOUNT]; // 数值孔径
    QLineEdit *lineEditWDC[LENSCOUNT]; // 工作距离
    QLineEdit *lineEditRulerLen[LENSCOUNT]; // 标尺长度
    QLineEdit *lineEditXCompensate[LENSCOUNT];
    QLineEdit *lineEditYCompensate[LENSCOUNT];

    QComboBox *comboBoxLensCount;
    QDialogButtonBox * buttonBox;
    QPushButton * buttonUpdate;

    QLineEdit *lineEditLineWidth;
    ColorComboBox * comboBoxColor;
    QLineEdit *lineEditFontSize;
    QLineEdit *lineEditRulerPosX;
    QLineEdit *lineEditRulerPosY;

    LensManager *lens;

};
} //namespace Qly
#endif // LENSMANAGEDIALOG_H
